package com.filepublic.demo.server.mapper;

import com.filepublic.demo.pojo.entity.FileEntity;
import com.filepublic.demo.pojo.entity.UserEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FileBaseMapper {

    /**
     * 根据id查文件
     * @param fileId
     * @return
     */
    @Select("select * from email_file where file_id = #{fileId}")
    FileEntity selectFileById(@Param("fileId") String fileId);

    /**
     * 基础插入
     * @param fileEntity
     */
    @Insert("insert into email_file values(#{fileId},#{fileName},#{fileSize},#{fileChunksNum})")
    void insertFile(FileEntity fileEntity);
}
